<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>量子投资组合优化报告</title>
    <style>
        body {
            font-family: 'Microsoft YaHei', Arial, sans-serif;
            line-height: 1.6;
            color: #333;
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
            background-color: #f8f9fa;
        }
        h1, h2, h3, h4 { 
            color: #2c3e50;
            border-bottom: 2px solid #3498db;
            padding-bottom: 10px;
        }
        .container { 
            background-color: white;
            padding: 30px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }
        .report-header { 
            text-align: center;
            margin-bottom: 30px;
        }
        table { 
            width: 100%;
            border-collapse: collapse;
            margin: 20px 0;
        }
        th, td { 
            padding: 12px;
            border: 1px solid #ddd;
            text-align: left;
        }
        th { 
            background-color: #f2f2f2;
            font-weight: bold;
        }
        tr:nth-child(even) { 
            background-color: #f9f9f9;
        }
        .data-section { 
            margin-bottom: 30px;
        }
        .risk-level { 
            display: inline-block;
            padding: 5px 10px;
            border-radius: 4px;
            font-weight: bold;
        }
        .risk-low { 
            background-color: #d4edda;
            color: #155724;
        }
        .risk-medium { 
            background-color: #fff3cd;
            color: #856404;
        }
        .risk-high { 
            background-color: #f8d7da;
            color: #721c24;
        }
        .footer { 
            text-align: center;
            margin-top: 40px;
            padding-top: 20px;
            border-top: 1px solid #ddd;
            color: #777;
            font-size: 0.9em;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="report-header">
            <h1>量子投资组合优化报告</h1>
            <p>生成时间: 2025-08-25 07:53:21</p>
            <p>分析方法: 量子算法模拟</p>
        </div>
        
        
        <div class="data-section">
            <h2>投资组合概览</h2>
            <table>
                <tr>
                    <th>总投资金额</th>
                    <th>预期回报率</th>
                    <th>预期风险</th>
                    <th>夏普比率</th>
                </tr>
                <tr>
                    <td>¥{budget:,.2f}</td>
                    <td>{expected_return:.2%}</td>
                    <td>{expected_risk:.2%}</td>
                    <td>{sharpe_ratio:.2f}</td>
                </tr>
            </table>
        </div>
        
        <div class="data-section">
            <h2>资产配置</h2>
            <table>
                <tr>
                    <th>股票代码</th>
                    <th>权重占比</th>
                    <th>分配金额</th>
                </tr>
        
                <tr>
                    <td>AAPL</td>
                    <td>18.82%</td>
                    <td>¥18,820.50</td>
                </tr>
            
                <tr>
                    <td>MSFT</td>
                    <td>19.22%</td>
                    <td>¥19,224.48</td>
                </tr>
            
                <tr>
                    <td>GOOG</td>
                    <td>8.00%</td>
                    <td>¥8,000.00</td>
                </tr>
            
                <tr>
                    <td>AMZN</td>
                    <td>24.95%</td>
                    <td>¥24,946.11</td>
                </tr>
            
                <tr>
                    <td>TSLA</td>
                    <td>29.01%</td>
                    <td>¥29,008.91</td>
                </tr>
            
            </table>
        </div>
        
        <div class="data-section">
            <h2>投资组合分析</h2>
            <p>此投资组合基于量子优化算法构建，平衡了风险与回报。根据您的风险容忍度 ({risk_tolerance:.0%}) 进行了调整，旨在最大化风险调整后收益。</p>
            <p>夏普比率是衡量风险调整后收益的重要指标，数值越高表示投资组合在每单位风险下获得的超额回报越多。</p>
        </div>
        
        
        <div class="footer">
            <p>量子金融分析系统 © 2025</p>
        </div>
    </div>
</body>
</html>